package com.bxmdm.ragdemo.tool;

import java.time.LocalDateTime;
import org.springframework.ai.tool.annotation.Tool;
import org.springframework.ai.tool.annotation.ToolParam;
import org.springframework.context.i18n.LocaleContextHolder;

public class DateTimeTools {

	@Tool(description = "获取用户当前时区的时间")
	String getCurrentDateTime() {
		return LocalDateTime.now().atZone(LocaleContextHolder.getTimeZone().toZoneId()).toString();
	}

	@Tool(description = "获取用户当前城市名称")
	String getUserCityName() {
		return "南京";
	}

	@Tool(description = "根据城市名称获取当前天气情况")
	String getWeatherByCityName(@ToolParam(description = "城市名称小写全拼音,例如:beijing") String cityName) {
		return "南京今天晴,温度5~16℃,风力3级;明天晴,温度6~21℃,风力3级";
	}
}
